package org.rc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.rc.entity.DczMember;
import org.rc.mapper.DczMemberMapper;
import org.rc.service.DczMemberService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DczMemberServiceImpl extends ServiceImpl<DczMemberMapper, DczMember> implements DczMemberService {

    @Override
    public void add(DczMember dczMember) {
        this.save(dczMember);
    }

    @Override
    public void batchAdd(List<DczMember> dczMembers) {
        this.saveBatch(dczMembers);
    }

    @Override
    public void deleteByDczId(Long dczId) {
        QueryWrapper<DczMember> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dcz_id",dczId);
        this.remove(queryWrapper);
    }

    @Override
    public List<DczMember> getByDczId(Long dczId) {
        QueryWrapper<DczMember> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dcz_id",dczId);
        return list(queryWrapper);
    }
}
